/**
 * Demonstrates a range of Button options the framework offers out of the box
 */
Ext.define('cloud.view.spot.Spotsign', {
    extend: 'Ext.Container',
    xtype: 'spotsign',
    requires: ['Ext.List', 'Ext.TitleBar', 'Ext.field.Select', 'Ext.field.Search', 'Ext.Img'],
    config: {
        layout: 'card',
        defaultBackButtonText: '返回',
        title:'签到列表',
        items: [

            {
                xtype: 'list',
                flex: 1,
                store: 'SpotsignStore',
                pressedCls: false,
                selectedCls: false,
                cls: 'x-list2',
                onItemDisclosure: true,
                emptyText: '没有签到记录',
                itemTpl: [
                    '<div class="listIcon">uuid : {uuid}</div></br>' +
                        '<div class="listConten">' +
                        '<span>景区名称：{name}</span>  ' +
                        '<span> 签到时间： {[Ext.Date.format(new Date(parseInt(values.lasttime) * 1000), "Y-m-d H:i")]}</span></div>'
                ].join(''),
                listeners: {
                    initialize: function () {
                        var store = Ext.getStore('SpotsignStore');
                        store.load();  // 产品分类
                        //store .getProxy().setExtraParam('cadid',localStorage.getItem('cadid'))
                    }
                },
                plugins: [
                    {
                        xclass: 'Ext.plugin.PullRefresh',
                        pullRefreshText: '下拉可以更新',
                        releaseRefreshText: '松开开始更新',
                        style: 'top:12px',
                        loadingText: '正在刷新……',
                        refreshFn: function (loaded, arguments) {
                            // loaded.getList().getStore().getProxy().setExtraParam('cadid',localStorage.getItem('cadid')); //设置proxy参数
                            loaded.getList().getStore().loadPage(1, {
                                callback: function (record, operation, success) {
                                    Ext.Viewport.unmask();
                                }, scope: this });
                        }
                    },
                    {
                        xclass: 'Ext.plugin.ListPaging',
                        loadMoreText: '<h2 style="text-align: center; padding-top: 20px; padding-bottom: 20px;">点击加载更多。。。。</h2>',
                        noMoreRecordsText: '<h2 style="text-align: center; padding-top: 20px; padding-bottom: 20px;">没有更多条记录了</h2>',
                        autoPaging: false //设置为TRUE将自动触发
                    }
                ]
            }
        ]
    }
});